#ifndef _UITOUCH_H_
#define _UITOUCH_H_

#include <QDateTime>
#include <QPointF>
class QGraphicsItem;
class UIWindow;

#define kUITouchMultiTapTime        (155)

typedef enum {
   UITouchPhaseBegan,
   UITouchPhaseMoved,
   UITouchPhaseEnded,
   UITouchPhaseCancelled,
} UITouchPhase;

class UITouchPrivate;
class UITouch {
    public:
        UITouch (UIWindow *window, QGraphicsItem *view = 0);
        ~UITouch();

        void start (const QPointF& pos);
        void move (const QPointF& pos);
        void stop (void);

        quint16 tapCount (void) const;

        qreal startX (void) const;
        qreal startY (void) const;
        QPointF startPos (void) const;

        qreal currentX (void) const;
        qreal currentY (void) const;
        QPointF currentPos (void) const;

        qreal deltaX (void) const;
        qreal deltaY (void) const;
        qreal absDeltaX (void) const;
        qreal absDeltaY (void) const;

        UITouchPhase phase (void) const;

        int timeElapsed (void) const;
        QDateTime timestamp (void) const;

        UIWindow *window (void) const;
        QGraphicsItem *view (void) const;

    private:
        UITouchPrivate *d;
};

#endif /* !_UITOUCH_H_ */

